<?PHP

class mvPDO extends PDO{

	function prepare($query, $options = array(), $supress_error = false){
		if ( $statement = parent :: prepare( $query, $options ) ){
			return $statement;
		}elseif(!$supress_error){
			mvError::sqlError('Error Preparing Statement', $query, $options, print_r($this->errorInfo(), true));
			return false;
		}else{
			return false;
		}
	}

	function prepare_execute($query, $parms = array(), $options = array(), $supress_error = false){
		if($query = $this->prepare($query, $options, $supress_error)){
			if(!$query->execute($parms, $supress_error))
				return false;
			return $query;
		}

		return false;
	}

}